package com.starlink.model.util;

import com.starlink.model.dtomapper.SchoolbagGroupCodeDtoMapper;
import com.starlink.model.domain.SchoolbagGroupCodeDO;
import com.starlink.model.vo.SchoolbagGroupCodeVO;
import com.google.common.collect.Lists;
import org.apache.commons.collections4.CollectionUtils;

import java.util.ArrayList;
import java.util.List;

/**
 * @author zhanghong
 */
public class SchoolbagGroupCodeConvert {

    public static List<SchoolbagGroupCodeVO> buildSchoolbagGroupCodeVoList(List<SchoolbagGroupCodeDO> schoolbagGroupCodeDOList) {
        if (CollectionUtils.isEmpty(schoolbagGroupCodeDOList)) {
            return Lists.newArrayList();
        }
        List<SchoolbagGroupCodeVO> schoolbagGroupCodeVOList = new ArrayList<>();
        for (SchoolbagGroupCodeDO schoolbagGroupCodeDO : schoolbagGroupCodeDOList) {
            schoolbagGroupCodeVOList.add(SchoolbagGroupCodeDtoMapper.INSTANCE.do2VO(schoolbagGroupCodeDO));
        }

        return schoolbagGroupCodeVOList;
    }
}
